home *** CD-ROM | disk | FTP | other *** search
/ 1st Multimedia Mac Shareware / Multimedia Shareware CD-ROM - BetaCorp.iso / Hypercard2.1 / HC 2.1 Docs / HyperCard 2.1 Release Notes < prev   
Encoding:
Text File  |  1991-06-13  |  16.6 KB  |  444 lines  |  [TEXT/MSWD]

  1.  
  2. HyperCard 2.1 Release Notes
  3. ©1991 Apple Computer, Inc.  All rights reserved.
  4.  
  5.  
  6. Overview of this Release
  7. ------------------------
  8.  
  9. HyperCard 2.1 is the version of HyperCard recommended for use with System
  10. 7.0. It is also compatible with System 6.0.5 and System 6.0.7.
  11.  
  12.  
  13. Revisions for Support of System 7.0 Features
  14. --------------------------------------------
  15.  
  16. These revisions are grouped by their associated Toolbox Manager.
  17.  
  18.  
  19. Alias Manager
  20.  
  21.     When the Alias Manager is present, HyperCard 2.1 will call it to
  22. resolve alias files.  Therefore, the following commands will work properly
  23. with alias files.
  24.  
  25.     go to stack <alias file>
  26.     open <alias file> with <alias file>
  27.     open file <alias file>
  28.     write to file <alias file>
  29.     read from file <alias file>
  30.     picture <alias file>
  31.  
  32.     The XCMD callback GetFilePath will also resolve alias files.
  33. Therefore, XCMDs that use this callback to locate files will require no
  34. revision to work with alias files.  (The Picture XCMD is an example.)
  35.  
  36.     In addition, if HyperCard finds an alias file when looking for the Home
  37. stack on startup, the alias file will be resolved.
  38.  
  39.  
  40. Apple Event Manager
  41.  
  42.     When the AppleEvent Manager is present, HyperCard 2.1 will use it to
  43. process and send Apple events.  HyperCard will recognize and handle the
  44. standard Apple events for opening documents, printing documents, quitting,
  45. executing a script, and evaluating an expression.
  46.  
  47.     In addition, several of HyperTalk's built-in commands will have the
  48. added ability to send specific Apple events to other applications.
  49.  
  50.     Event class  Event ID       Related HyperTalk command
  51.     -----------  --------       -------------------------
  52.     'aevt'       'oapp'         open <application>
  53.     'aevt'       'odoc'         open <document> with <application>
  54.     'aevt'       'pdoc'         print <document> with <application>
  55.     'aevt'       'quit'         close <application>
  56.     'aevt'       'clos'         close <document> with <application>
  57.     'misc'       'dosc'         send <expr> to program <programExpr>
  58.     'misc'       'eval'         request <expr> of program <programExpr>
  59.  
  60.     If you want to launch another application or open a document with
  61. another application, use the HyperTalk command "open".  If you want to
  62. print a document with another application, use the command "print".  If you
  63. want to close a document in another application or quit another
  64. application, use the command "close".  If you want to execute a script or
  65. macro in another application, use the HyperTalk command "send".  If you
  66. want to evaluate an expression in another application, use the command
  67. "request".
  68.  
  69.     Please note that among these Apple events, only 'oapp', 'odoc', 'pdoc',
  70. and 'quit' are universally supported.  All other Apple events that
  71. HyperCard can send will be effective only if the target application
  72. includes specific support for them. For example,
  73.  
  74.     close "My Expense Report" with "FabCalc"
  75.  
  76. will work properly only if the application FabCalc supports the 'clos'
  77. Apple event.
  78.  
  79.     The "open", "print", and "close" commands will work only with
  80. applications that reside on the same machine as HyperCard.  The "send" and
  81. "request" commands will work with any linkable program running on the
  82. network. See "Determining the Target Program", below.
  83.  
  84. Sending scripts to other programs
  85.  
  86.     The send command in HyperTalk will send a "do script" Apple event from
  87. HyperCard to another application running remotely.  It can be used to send
  88. a script to any program that understands the standard 'dosc' Apple event.
  89. By default, HyperCard waits for a reply from the target program before
  90. continuing. However, you can specify that you don't want to wait for a
  91. reply.
  92.  
  93.     Examples:
  94.  
  95.     send "make waves" to program "De Anza 6/2nd:WildCraft:HyperCard"
  96.     send "build {project}" to program "MPW Shell" without reply
  97.  
  98. Evaluating expressions in other programs
  99.  
  100.     The request command in HyperTalk will send an "evaluate expression"
  101. Apple event from HyperCard to another application running remotely.  It can
  102. be used to send an expression to any program that understands the standard
  103. 'eval' Apple event.  The value of the expression will be put into the local
  104. variable "it".
  105.  
  106.     Examples:
  107.  
  108.     request "the name of this stack" of program "HyperCard"
  109.     request "{target}" from program "MPW Shell"
  110.  
  111. Handling failures
  112.  
  113.     The "send", "open", "print", "close", and "request" commands set "the
  114. result" as follows when they fail.
  115.  
  116. Condition                               the result
  117. ---------                               ---------------
  118. User canceled the "Link to program"     "Cancel"
  119.   dialog.
  120. Target program didn't handle event.     "Not handled by target program"
  121. Target program timed out.               "Timeout"
  122. Target program returned error string    the string
  123.   in reply.
  124. Target program returned error number    "Got error <errorNum>
  125.   in reply, or AESend returned some       when sending Apple( event"
  126.   other error.
  127.  
  128. Establishing program links
  129.  
  130.     When sending Apple events to another program, if HyperCard has not
  131. established a link with the target program, the user will be presented with
  132. a dialog, through which the link will be established.  If a link has
  133. already been established between HyperCard and the target program, the
  134. Apple event will be sent without further user interaction.
  135.  
  136. Determining the target program
  137.  
  138.     The target program for Apple events is specified by a string in the
  139. following format:
  140.  
  141.     zone:machine:program
  142.  
  143.     Examples:
  144.  
  145.     "Fifth Floor:Gizmo:MacWrite"
  146.     "Baby mac:MacWrite"
  147.         -- zone omitted; HyperCard assumes same zone
  148.     MacWrite
  149.         -- zone and machine omitted; HyperCard assumes same zone,
  150.             same machine
  151.  
  152.     HyperCard's address on the network is contained in the property, "the
  153. address".
  154.  
  155.     You can use the itemDelimiter property to parse program addresses.
  156. For example, given a string that specifies a target program, the following
  157. HyperTalk function will return the name of the program if you send it a
  158. colon as the delimiter and the string as the text.
  159.  
  160.     function lastHCItem delim,theText
  161.       put the itemDelimiter into savedDelimiter
  162.       set the itemDelimiter to delim
  163.       put the last item of theText into lastItem
  164.       set the itemDelimiter to savedDelimiter
  165.       return lastItem
  166.     end lastHCItem
  167.  
  168. Choosing a target program
  169.  
  170.     The answer command has been extended for use with the Program Linking
  171. dialog, so that scripters can allow users to select a program to link to.
  172.  
  173.     answer program prompt { of type <factorList> }
  174.  
  175. When used in this way, the answer command displays the PPC browser, from
  176. which the user can select any program running on any machine connected to
  177. the AppleTalk network.  A string representing the program the user selects
  178. is placed into the local variable "it".
  179.  
  180. Examples:
  181.  
  182.     answer program "Where did you say that program was again?"
  183.     answer program "Choose a spelling checker:" of type "Spellcheck"
  184.  
  185.     In addition,  a scripter can determine which programs are running on
  186. the same machine as HyperCard by examining the new HyperTalk function, "the
  187. programs".  It returns a return-delimited list of all the linkable programs
  188. currently running on the same machine as HyperCard.
  189.  
  190. Handling Apple events
  191.  
  192.     When HyperCard receives an Apple event, it will send a new HyperTalk
  193. system message, "appleEvent", to the current card, along with parameters
  194. that enable a script to determine the class, id, and the sender of the
  195. Apple event.  For example, when the Finder sends HyperCard an Apple event
  196. of class 'aevt' and id 'odoc', HyperCard sends the HyperTalk message
  197. "appleEvent aevt,odoc,Finder" to the current card.
  198.  
  199.     A script that handles an appleEvent message can gather the parameters
  200. of the Apple event by using the new HyperTalk command "request".
  201.  
  202.     request appleEvent data { [ of | with ] keyword <expr> }
  203.  
  204. This command puts the parameter or attribute with the specified keyword
  205. into the local variable "it".  For example, you can obtain a parameter of
  206. keyword "errs", the standard Apple event keyword for an error string, as
  207. follows:
  208.  
  209.     request appleEvent data with keyword "errs"
  210.     put it into errorString
  211.  
  212. If there is no attribute or parameter with the keyword you specify,
  213. HyperCard sets the result to "Not found".
  214.  
  215.     If you don't supply a keyword, HyperCard assumes you're requesting the
  216. direct object of the Apple event, which is defined by the Apple event
  217. manager as the parameter with keyword "----".  The request command also
  218. supports several special cases for important attributes of Apple events:
  219.  
  220.     request appleEvent class
  221.     request appleEvent id
  222.     request appleEvent sender
  223.     request appleEvent return id
  224.  
  225.     HyperCard will attempt to convert all the Apple event parameters to
  226. strings, for use in HyperTalk.  The Apple event manager automatically
  227. handles the conversion of numerical forms to strings; HyperCard installs
  228. coercion handlers for alias records, return ids, process serial numbers,
  229. target ids, class and id types, and lists.
  230.  
  231.     If an incoming Apple event specifies that user action is not
  232. permissible, the global property lockErrorDialogs will automatically be set
  233. to TRUE (see "Error Handling", below).  The scripter can override this
  234. setting.
  235.  
  236.     Example:  a scripter defines an event of class 'WILD' and id 'cnvt' as
  237. a request to convert a 1.2.5 stack to the 2.0 file format.  The direct
  238. object of the Apple event is defined to be the pathname of the stack.  The
  239. following script will do the trick.
  240.  
  241.     on appleEvent eventClass,eventID,sender
  242.       if eventClass & eventID is not "WILDcnvt"
  243.       then pass appleEvent
  244.       else
  245.         request appleEvent data
  246.         if it is empty then exit appleEvent
  247.         go to stack it
  248.         if the result is not empty then exit appleEvent
  249.  
  250.         if there is a menuItem "Convert Stack..." in menu "File"
  251.         then doMenu "Convert Stack..." without dialog
  252.       end if
  253.     end appleEvent
  254.  
  255.     Example:  when a stack is opened from the Finder while HyperCard is
  256. running, HyperCard 2.1 will open the stack in a new window.  This behavior
  257. is different from previous versions of HyperCard, which would go to the
  258. stack in the currently active window.  If you prefer the old behavior, you
  259. can put the following script in your Home stack.
  260.  
  261.     on appleEvent eventClass,eventID,sender
  262.       if eventClass & eventID is not "aevtodoc"
  263.       then pass appleEvent
  264.       else
  265.         request appleEvent data
  266.         put line 1 of it into stackToOpen
  267.         go to stack stackToOpen
  268.       end if
  269.     end appleEvent
  270.  
  271.     If HyperCard receives the appleEvent message, either because it was not
  272. intercepted by a script or because it was passed to it by a script,
  273. HyperCard will check whether the current Apple event is of the types it
  274. knows how to respond to, and if so, will treat it appropriately.  HyperCard
  275. 2.1 will recognize the following standard Apple events: 'odoc', 'pdoc',
  276. 'quit', 'dosc', and 'eval'.
  277.  
  278.     HyperCard responds to the 'odoc' event by checking whether the
  279. specified files are stacks and, if so, opening them, each in a new window.
  280.  
  281.     HyperCard responds to the 'pdoc' event by checking whether the
  282. specified files are stacks and, if so, opening them one at a time in a new
  283. window, printing them, and closing them again.
  284.  
  285.     HyperCard responds to the 'quit' event just as it would if "Quit
  286. HyperCard" were chosen from the File menu.
  287.  
  288.     HyperCard responds to a 'dosc' event by compiling and executing the
  289. HyperTalk statements sent to it as the direct object of the event.
  290.  
  291.     HyperCard responds to an 'eval' event by evaluating the expression sent
  292. to it as the direct object of the event and putting the value into the
  293. direct object of the reply.
  294.  
  295. Replying to Apple events
  296.  
  297.     Scripters can reply to Apple events from HyperTalk with a new command,
  298. "reply".
  299.  
  300.     reply <expr> { with keyword <expr> }
  301.  
  302. If you don't specify a keyword for the reply parameter, the parameter will
  303. become the direct parameter of the reply.  If you wish to return an error
  304. string, you can use the following form of the reply command:
  305.  
  306.     reply error <expr>
  307.  
  308. This is equivalent to:
  309.  
  310.     reply <expr> with keyword "errs"
  311.  
  312.     The reply event is sent when the chain of execution is complete.
  313.  
  314.     For example, the following script will handle Apple events of class
  315. 'WILD' and type 'defn' by searching for a string in a background field
  316. named "Glossary Entry" and returning the contents of a background field
  317. named "Definition".
  318.  
  319.     on appleEvent eventClass,eventID,sender
  320.       if eventClass is "WILD" and eventID is "defn" then
  321.         request appleEvent data
  322.         find it in field "Glossary Entry"
  323.         if the result is empty  -- successful find
  324.         then reply field "Definition"
  325.         else reply error "Not found"
  326.       else pass appleEvent
  327.     end appleEvent
  328.  
  329. The "request" and "reply" commands set the result to "No current Apple(
  330. event." when there is no current Apple event to handle.
  331.  
  332.  
  333. Miscellaneous Revisions
  334. -----------------------
  335.  
  336. Menus
  337.  
  338.     When you ask for the names of the Apple, Help, and Application menus
  339. from HyperTalk, you get "Apple", "System Help", and "Application",
  340. respectively.
  341.  
  342. Error Handling
  343.  
  344.     In order to execute scripts without interaction with the user, as well
  345. as to provide a better means for testing HyperCard's error messages, it's
  346. now possible to lock error dialogs and to put HyperTalk into a "quiet
  347. mode" for script execution.  When HyperTalk encounters an error while in
  348. "quiet mode", it aborts execution of pending scripts just as it normally
  349. would, but instead of displaying a dialog with an error message, it sends a
  350. "errorDialog" message to the current card with the error message as its
  351. parameter.  This message substitutes for the first "idle" message that
  352. would be sent in normal mode after HyperTalk cleans up and HyperCard
  353. returns to its main event loop.
  354.  
  355.     Example:
  356.  
  357.     set lockErrorDialogs to TRUE  -- puts HyperTalk into "quiet mode"
  358.     lock error dialogs  -- an alternate form
  359.     unlock error dialogs
  360.  
  361. When HyperCard receives an Apple event for which the sender has specified
  362. that no user interaction is allowed, it will automatically set
  363. lockErrorDialogs to TRUE before handling the event.
  364.  
  365. Determining which version of System Software is running
  366.  
  367.     A new function has been added to HyperTalk, "the systemVersion".  It
  368. returns the version of system software is running in a decimal string.  For
  369. example, it will return 6.07 instead of 6.0.7, to allow scripters to use it
  370. with HyperTalk's arithmetic operators.
  371.  
  372. Specifying Windows
  373.  
  374.     You can now refer to windows by number and by id as well as by name.
  375. Therefore, the following commands are now valid.
  376.  
  377.     get the id of the card window
  378.     set the loc of window 1 to 50,50
  379.     hide last window
  380.  
  381.     Both the Picture and Palette XCMDs now send the id of a newly created
  382. window as an additional parameter to its open message.  For example, after
  383. the Picture XCMD creates a new window, it sends the following message to
  384. the current card:
  385.  
  386.     openPicture <name of window>,<id of window>
  387.  
  388. Read and Write
  389.  
  390.     The HyperTalk "read" and "write" commands have been enhanced.  The
  391. following examples are now valid.
  392.  
  393.     read from file "Fred" at 100 for 12
  394.     read from file "Fred" until end  -- 'eof' works too
  395.     write myVar to file "Fred" at 200
  396.     write moreStuff to file "Fred" at end  -- 'eof' works too
  397.  
  398. In addition, the 16K limit on the amount of text that could be read at once
  399. has been removed.  If the amount of text you ask for won't fit in memory,
  400. HyperCard sets the result to "Not enough memory to read from file."
  401.  
  402. Getting the internal modem for the Portable to work with "dial"
  403.  
  404.     A new global property, "the dialingTime", has been added, especially
  405. for users of the internal modem for the Macintosh Portable.  It determines
  406. how long HyperCard waits, in ticks, after sending the dial string, before
  407. closing the serial connection with the modem.   The default is 180 (3
  408. seconds).
  409.  
  410. Owners
  411.  
  412.     Windows and cards now have an "owner" property.  For windows, the owner
  413. is determined as follows.
  414.  
  415.     Creator                   Owner
  416.     ----------                ----------
  417.     HyperCard                 "HyperCard"
  418.     desk accessory or driver  "System"
  419.     XCMD                      the name of the XCMD
  420.     anything else             "Unknown"
  421.  
  422.     The owner of a card is the name of its background.
  423.  
  424. More Parameters Available
  425.  
  426.     The parameters for the "start", "stop", and "set" commands are now
  427. available within overriding handlers.
  428.  
  429.  
  430. Summary
  431. -------
  432.  
  433.     New messages:  appleEvent, errorDialog
  434.     New commands:  request, reply
  435.     New functions:  programs(), systemVersion()
  436.     New properties:  the address, the itemDelimiter, the lockErrorDialogs,
  437. the dialingTime, the owner
  438.     New constants:  comma, colon
  439.  
  440.     Enhanced commands: open, print, close, send, read, write, answer, lock,
  441. unlock, set, start, stop
  442.  
  443. Author: CALHOUN.K
  444.